import { message } from 'antd'

// 配置全局消息设置
message.config({
  top: 24,
  duration: 3,
  maxCount: 3,
})

const AToast = {
  success: (content) => {
    return message.open({
      type: 'success',
      content: content,
      duration: 3,
    })
  },

  error: (content) => {
    return message.open({
      type: 'error',
      content: content,
      duration: 3,
    })
  },

  warning: (content) => {
    return message.open({
      type: 'warning',
      content: content,
      duration: 3,
    })
  },

  info: (content) => {
    return message.open({
      type: 'info',
      content: content,
      duration: 3,
    })
  },
}

export default AToast
